__author__ = "Alex, Darren"

from ChessBoard import *
import unittest

class TestParseTextMove(unittest.TestCase):
    """Class by Alex and Darren
       run with python -m unittest TestParseTextMove
    """
    def setUp(self):
        self.chessboard=ChessBoard()

    def test_emptyString(self):
        self.assertIsNone(self.chessboard._parseTextMove(""))	

    def test_specialOOTurn0(self):
        self.assertEqual(self.chessboard._turn, 0)
        self.assertEqual(self.chessboard._parseTextMove("O-O"), (None, 4, 7, 6, 7, None))

    def test_special00Turn1(self):
        """Assumed ChessConsts.BLACK=1 and ChessConsts.WHITE=0.
        These constants should be used, but the tested function is using them iether.
        """
        self.chessboard._turn = 1
        self.assertEqual(self.chessboard._parseTextMove("O-O"), (None, 4, 0, 6, 0, None))
	
    def test_specialOOOTurn0(self):
        self.assertEqual(self.chessboard._turn, 0)
        self.assertEqual(self.chessboard._parseTextMove("O-O-O"), (None, 4, 7, 2, 7, None))
    
